home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2006 September
/
PCWorld_2006-09_cd.bin
/
v cisle
/
hexer
/
mpth_17.exe
/
{app}
/
scripts
/
start-stop
/
startup.mps
< prev
Wrap
Text File
|
2005-05-22
|
1KB
|
72 lines
INCLUDE 'def.mps'
OPTION UNDO, 0
call DEC_TEXT_CONV
DEF reg envparse("%appregkey%\\openfiles")
var f file d dword
= check if only an untitled window is open
if file_count > 1
end
endif
if file_count == 1
if (textupper(files(0)) != 'UNTITLED1') and (textupper(files(0)) != 'UNBENANNT1')
end
endif
= file must be empty
if textupper(files(0)) == 'UNTITLED1'
currentfile='UNTITLED1'
else
currentfile='UNBENANNT1'
endif
f = fileopen('::current','r')
d = filesize(f)
fileclose f
if d != 0
end
endif
!cmd.fileclose
endif
= read files from registry and open them
var filenames text
if (not regread(reg, "files", @filenames)):end:endif
if (filenames == ''):end:endif
errorhandler skip1
!cmd.FileOpen filenames
@@skip1
loop checkopenfile file_count
= read active file
var act text
if (not regread(reg, "active", @act)):end:endif
= set active file
if (act != '')
errorhandler endlabel
currentfile=act
endif
@@endlabel
end
@@checkopenfile
var fn text
var st dword co dword
fn = files(loop)
if (regread(reg, fn+":selstart", @st) and regread(reg, fn+":selcount", @co))
f = fileopen('::'+fn, 'rw')
errorhandler cof1
filesetprop f, "selstart", st
filesetprop f, "selcount", co
@@cof1
fileclose f
endif
return